Skip to content

Conversation

@tonyxty
Copy link
Contributor

@tonyxty tonyxty commented Aug 10, 2025

This PR is part of #191.

Add a evaluation_object parameter which, when present, will be used instead of evaluation_file for evaluation tasks.

Example usage: in the online judge example, it would be easier to add a command line argument that enables the user to select their own favorite problem.

Note: if the evaluation_object modifies itself in the evaluation functions, such modifications are not guaranteed to be visible in later calls due to the multi-process nature of the evaluation process.

@tonyxty
Copy link
Contributor Author

tonyxty commented Aug 13, 2025

@codelion What do you think?

@codelion
Copy link
Member

Can you update from main, maybe we should add an example that shows how to use it as a library with this evaluation object instead of file. Otherwise looks good.

@tonyxty
Copy link
Contributor Author

tonyxty commented Aug 14, 2025

Added a variant of the online judge example.

@codelion
Copy link
Member

Added a variant of the online judge example.

This example still seems to use initial_program.py and evaluator.py files. I thought you were proposing a way to use the openevolve as a library without the need to supply the files? I am trying to understand what benefit does having an evaluation object give in this example?

@tonyxty
Copy link
Contributor Author

tonyxty commented Aug 15, 2025

It still has evaluator.py as a separate file but only for modularity - you can put the Evaluator class in the main.py file.

But the point is not merely combining files - in this example, it makes it possible for the user to pick the problem to solve at runtime, e.g., from the command line.

To implement such functionality without evaluation objects, the program will have to modify the evaluator.py file at runtime, which is difficult to manage.

@tonyxty
Copy link
Contributor Author

tonyxty commented Aug 15, 2025

I guess a slightly more general way of explaining is that evaluation objects can have parameters stored in them, be it the problem to solve, timeout value, or something else.

Meanwhile, if one wants to communicate a parameter to a evaluator file, one has to either modify its source - and it can easily get messy when there are multiple parameters; or have the evaluator module read from yet another config file, which adds unnecessary complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants